#include<iostream>

using namespace std;

int main(int argc, char const *argv[])
{
    int bg,ed,count=0,a[400]={0};
    scanf("%d %d",&bg,&ed);
    while (bg<=ed)
    {
        if (bg&3||(bg%100==0&&bg%400!=0))
        {
            bg++;
            continue;
        }
        a[count++]=bg++;
    }
    cout<<count<<endl;
    for (int i = 0; a[i]; i++)
    {
        cout<<a[i]<<" ";
    }
    
    
    return 0;
}
